Skip to content

Fill postal code from block-less re-query when dadata lacks it - #521

Open
ekateluv wants to merge 2 commits into
mainfrom
fix/soft-7320-postal-index
Open

Fill postal code from block-less re-query when dadata lacks it#521
ekateluv wants to merge 2 commits into
mainfrom
fix/soft-7320-postal-index

Conversation

@ekateluv

@ekateluv ekateluv commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Что происходит; кому и зачем нужно:

после выбора адреса с корпусом из подсказок дадаты поле «Почтовый индекс» оставалось пустым (dadata suggest отдаёт postal_code: null для многих домов с корпусом) и блокировало оформление заказа. Теперь в этом случае индекс добирается повторным запросом к дадате без корпуса (у здания индекс один), с проверкой, что вернулась та же улица и дом.


Что поменялось для пользователей:

При выборе адреса вида «Огородный пр-д, д 5 к 2» индекс подставляется автоматически, заказ оформляется без ручного ввода индекса.


Как проверял/а:

на тестовом


Чеклист ревью:

Перед мержем не забудь проверить:

  • правописание в тексте, опечатки

Опционально (но важно для изменений в инфраструктуру):

  • задеплоить на stage, чтобы проверить, что все работает

…s it

Dadata house-level suggestions for buildings with a block (к N) often
return postal_code=null, leaving the required postcode field empty and
blocking checkout. When that happens, re-query dadata without the block
part — the building index is the same.
@ekateluv
ekateluv requested a review from a team as a code owner August 14, 2026 07:03
@codacy-production

codacy-production Bot commented Aug 14, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 17 complexity · 0 duplication

Metric Results
Complexity 17
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Accept the fallback postcode only when the returned suggestion matches
the selected street and house, so a fuzzy match can't inject a wrong
index. Extract dadataSuggest() shared by all three call sites.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant